package com.isoft.illustrationsdraw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft.illustrationsdraw.entity.Comment;
import com.isoft.illustrationsdraw.mapper.CommentMapper;
import com.isoft.illustrationsdraw.service.CommentService;

import java.util.List;

import org.springframework.stereotype.Service;

@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {
    @Override
    public List<Comment> getCommentsByIllustrationId(Long illustrationId) {

        LambdaQueryWrapper<Comment> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(Comment::getIllustrationsId, illustrationId);

        return list(lambdaQueryWrapper);
    }
}
